{% extends "projects/project_edit_base.html" %}
{% load i18n %}

{% block title %}{% trans "Edit Project Versions" %}{% endblock %}

{% block project-versions-active %}active{% endblock %}
{% block editing-option-edit-proj %}class="active"{% endblock %}

{% block project_edit_content_header %}{% trans "Versions" %}{% endblock %}

{% block project_edit_content %}
  <form method="post" action=".">{% csrf_token %}

{% for field in form %}

    {% if forloop.first  %}
        {# This is a custom form listing the possible active versions, to make 1 the default #}
        <h2> {{ field.label }} </h2>
        {{ field }}
    <p>
      {% trans "Choose the version that / will redirect to." %}
    </p>

    {% else %}

        {% if forloop.counter0 == 1 %}
            <h2> {% trans "Choose Active Versions" %} </h2>
            <p>
            {% trans "Active versions below will show up on the site." %}
            </p>
        {% endif %}


        {% if field.label == "privacy" %}
          {{ field }}

        {% comment %}
        {% elif field.label == "tags" %}
            {% trans "Tags" %}: {{ field }}
        {% endcomment %}

        {% else %}
        {# This is a custom field with a label of the version, and a value of a checkbox denoting if it is active #}
        <h3>{{ field.label}}</h3>
          {% trans "Active" %} {{ field }}
        {% endif %}
    {% endif %}
    <br>
{% endfor %}

    <p>
      <input style="display: inline;" type="submit" value="{% trans "Submit" %}">
    </p>
  </form>
{% endblock %}
